<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="com.wenwu.common.utils.Status.AttachmentFrom"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="path" value="${pageContext.request.contextPath }" />
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>保护区划及保护情况</title>
<script type="text/javascript" src="${path}/js/scripts/bootstart.js"></script>
<link rel="stylesheet" type="text/css" href="${path}/css/focus.css" />
</head>
<body>
	<!-- 附件上传 -->
	<script type="text/plain" id="myEditorFile"></script>
	<form id="umprotectAreaForm" method="post">
		<div style="display: none;">
			<input name="protectId" class="mini-textbox" id="protectId"
				value="${relicsProtectArea.protectId}" /> <input name="basicId"
				class="mini-textbox" id="basicId"
				value="${relicsProtectArea.basicId}" /> <input
				name="protectBasicId" id="protectBasicId" class="mini-textbox"
				value="${rpb1.protectBasicId}" /> <input name="protectBasicId"
				id="protectArea" class="mini-textbox" value="${rpb2.protectBasicId}" />
			<input name="protectBasicId" id="controlArea" class="mini-textbox"
				value="${rpb3.protectBasicId}" /> <input name="flag"
				class="mini-textbox" value="flag1" /> <input name="flag"
				class="mini-textbox" value="flag2" /> <input name="flag"
				class="mini-textbox" value="flag3" />
		</div>
		<div class="form_nav">
			<table width="100%" cellpadding="4" cellspacing="0">
				<tr>
					<td width="15%" class="xx_bt nonebor">文物名称:</td>
					<td width="40%" class="xx_type  nonebor"><input id="basicName"
						name="basicName" style="width: 97%;" class="mini-textbox"
						vtype="maxLength:100" allowInput="false"
						value="${relicsProtectArea.basicName}" /><span
						class="required_cls">*</span></td>
					<td width="8%"></td>
					<td width="37%"></td>
				</tr>
				<tr>
					<td class="xx_bt">保护本体区</td>
					<td class="xx_type" colspan="3">
						<table id="protectBasicIdTable" width="100%">
							<tr>
								<td width="13%" class="xx_bt nonebor">划定机关:</td>
								<td width="40%" class="xx_type nonebor"><input
									name="delimitOrgan" style="width: 90%;" class="mini-textbox"
									value="${rpb1.delimitOrgan}" /> <span class="required_cls">*</span></td>
								<td width="10%" class="xx_bt nonebor">公布机关:</td>
								<td width="37%" class="xx_type nonebor"><input
									name="publishOrgan" style="width: 90%;" class="mini-textbox"
									value="${rpb1.publishOrgan}" /> <span class="required_cls">*</span></td>
							</tr>
							<tr>
								<td class="xx_bt">本体范围:</td>
								<td class="xx_type" colspan="3"><input name="area"
									id="area1" style="width: 97%;" class="mini-textarea"
									value="${rpb1.area}" /> <span class="required_cls">*</span></td>
							</tr>
							<tr>
								<td class="xx_bt">变更情况:</td>
								<td class="xx_type" colspan="3"><input
									name="changeSituation" style="width: 97%;"
									class="mini-textarea" value="${rpb1.changeSituation}" /> <span
									class="required_cls">*</span></td>
							</tr>
							<tr>
								<td class="xx_bt">公布日期:</td>
								<td class="xx_type"><input class="mini-datepicker"
									style="width: 80%;" allowInput="false" name="publishDate"
									format="yyyy-MM-dd" value="${rpb1.publishDate}" /> <span
									class="required_cls">*</span></td>
								<td></td>
								<td></td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td class="xx_bt">保护范围区:</td>
					<td class="xx_type" colspan="3">
						<table id="protectAreaTable" width="100%">
							<tr>
								<td width="13%" class="xx_bt nonebor">划定机关:</td>
								<td width="40%" class="xx_type nonebor"><input
									name="delimitOrgan" style="width: 90%;" class="mini-textbox"
									value="${rpb2.delimitOrgan}" /> <span class="required_cls">*</span></td>
								<td width="10%" class="xx_bt nonebor">公布机关:</td>
								<td width="37%" class="xx_type nonebor"><input
									name="publishOrgan" style="width: 90%;" class="mini-textbox"
									value="${rpb2.publishOrgan}" /> <span class="required_cls">*</span></td>
							</tr>
							<tr>
								<td class="xx_bt">本体范围:</td>
								<td class="xx_type" colspan="3"><input name="area"
									style="width: 97%;" class="mini-textarea" value="${rpb2.area}" />
									<span class="required_cls">*</span></td>
							</tr>
							<tr>
								<td class="xx_bt">变更情况:</td>
								<td class="xx_type" colspan="3"><input
									name="changeSituation" style="width: 97%;"
									class="mini-textarea" value="${rpb2.changeSituation}" /> <span
									class="required_cls">*</span></td>
							</tr>
							<tr>
								<td class="xx_bt">公布日期:</td>
								<td class="xx_type"><input class="mini-datepicker"
									style="width: 80%;" allowInput="false" name="publishDate"
									format="yyyy-MM-dd" value="${rpb2.publishDate}" /> <span
									class="required_cls">*</span></td>
								<td></td>
								<td></td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td class="xx_bt">建设控制地带:</td>
					<td class="xx_type" colspan="3">
						<table id="controlAreaTable" width="100%">
							<tr>
								<td width="13%" class="xx_bt nonebor">划定机关:</td>
								<td width="40%" class="xx_type nonebor"><input
									name="delimitOrgan" style="width: 90%;" class="mini-textbox"
									value="${rpb3.delimitOrgan}" /> <span class="required_cls">*</span></td>
								<td width="10%" class="xx_bt nonebor">公布机关:</td>
								<td width="37%" class="xx_type nonebor"><input
									name="publishOrgan" style="width: 90%;" class="mini-textbox"
									value="${rpb3.publishOrgan}" /> <span class="required_cls">*</span></td>
							</tr>
							<tr>
								<td class="xx_bt">本体范围:</td>
								<td class="xx_type" colspan="3"><input name="area"
									style="width: 97%;" class="mini-textarea" value="${rpb3.area}" />
									<span class="required_cls">*</span></td>
							</tr>
							<tr>
								<td class="xx_bt">变更情况:</td>
								<td class="xx_type" colspan="3"><input
									name="changeSituation" style="width: 97%;"
									class="mini-textarea" value="${rpb3.changeSituation}" /> <span
									class="required_cls">*</span></td>
							</tr>
							<tr>
								<td class="xx_bt">公布日期:</td>
								<td class="xx_type"><input class="mini-datepicker"
									style="width: 80%;" allowInput="false" name="publishDate"
									format="yyyy-MM-dd" value="${rpb3.publishDate}" /> <span
									class="required_cls">*</span></td>
								<td></td>
								<td></td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td class="xx_bt">建设项目控制情况:</td>
					<td class="xx_type" colspan="3"><input
						name="developProjectSituation" style="width: 97%;"
						class="mini-textarea"
						value="${relicsProtectArea.developProjectSituation}" /><span
						class="required_cls">*</span></td>
				</tr>
				<tr>
					<td class="xx_bt">保护机构:</td>
					<td class="xx_type"><input name="protectOrgan"
						showNullItem="true" id="protectOrgan" nullItemText="请选择保护机构"
						textField="organName" valueField="organId" allowInput="false"
						url="${path}/mgr/protectArea/getRelicsOrganization"
						style="width: 97%;" class="mini-combobox"
						value="${relicsProtectArea.protectOrgan}" /><span
						class="required_cls">*</span></td>
				</tr>
				<tr>
					<td class="xx_bt">保护标志:</td>
					<td class="xx_type" colspan="3"><input name="protectFlag"
						style="width: 97%;" class="mini-textarea"
						value="${relicsProtectArea.protectFlag}" /><span
						class="required_cls">*</span></td>
				</tr>
				<tr>
					<td class="xx_bt">安全保卫工作:</td>
					<td class="xx_type" colspan="3"><input
						name="secureWorkSituation" style="width: 97%;"
						class="mini-textarea"
						value="${relicsProtectArea.secureWorkSituation}" /><span
						class="required_cls">*</span></td>
				</tr>
				<tr>
					<td class="xx_bt">安全保卫组织:</td>
					<td class="xx_type" colspan="3"><input
						name="secureProtectOrgan" style="width: 97%;"
						class="mini-textarea"
						value="${relicsProtectArea.secureProtectOrgan}" /><span
						class="required_cls">*</span></td>
				</tr>
				<tr>
					<td class="xx_bt">监控设施:</td>
					<td class="xx_type" colspan="3"><input
						name="monitorInstallation" style="width: 97%;"
						class="mini-textarea"
						value="${relicsProtectArea.monitorInstallation}" /><span
						class="required_cls">*</span></td>
				</tr>
				<tr>
					<td class="xx_bt">防盗设施:</td>
					<td class="xx_type" colspan="3"><input
						name="guardInstallation" style="width: 97%;" class="mini-textarea"
						value="${relicsProtectArea.guardInstallation}" /><span
						class="required_cls">*</span></td>
				</tr>
				<tr>
					<td class="xx_bt">消防设施:</td>
					<td class="xx_type" colspan="3"><input name="fireInstallation"
						style="width: 97%;" class="mini-textarea"
						value="${relicsProtectArea.fireInstallation}" /><span
						class="required_cls">*</span></td>
				</tr>


				<tr>
					<td class="xx_bt">附件:</td>
					<td class="xx_type"><input name="file" style="width: 90%;"
						class="mini-textarea" value="${relicsProtectArea.file}" /><span
						class="required_cls">*</span></td>
					<td class="xx_bt">
						<!-- 附件上传开始 --> <a class="mini-button" iconCls="icon-upload"
						onclick="upFiles('<%=AttachmentFrom.RELICS_PROTECT_AREA_01%>','showfiles')">浏览</a>
						<!-- 附件上传结束-->
					</td>
					<td class="xx_type" id="showfiles"><c:if
							test="${param.flag=='edit'}">
							<c:if test="${!empty attachments}">
								<c:forEach var="att" items="${attachments}">
									<c:if test="${att.attachmentOwner == 31}">
										<input type="hidden" value="${att.attachmentPath}"
											name="filePath">
										<input type="hidden" value="${att.attachmentName}"
											name="fileName">
										<input type="hidden" value="${att.attachmentOwner}"
											name="attachmentOwner">
										<a target="_blank" href="${att.attachmentPath}" class="views">${att.attachmentName}</a>
										<br />
									</c:if>
								</c:forEach>
							</c:if>
						</c:if></td>
				</tr>
			</table>
		</div>
		<div style="text-align: center; padding: 10px;">
			<a class="mini-button" onclick="addform.saveData" id="sub_button"
				iconCls="icon-save" style="width: 60px; margin-right: 20px;">保存</a>
			<a iconCls="icon-cancel" class="mini-button"
				onclick="$.form.onCancel()" style="width: 60px;">取消</a>
		</div>
	</form>
</body>
<script type="text/javascript" src="${path}/js/scripts/dataform.js"></script>
<script type="text/javascript" charset="utf-8"
	src="${path}/js/scripts/swfupload/swfupload.js"></script>
<script type="text/javascript"
	src="${path}/js/scripts/plugin/ueditor/ueditor.config.js"></script>
<script type="text/javascript"
	src="${path}/js/scripts/plugin/ueditor/ueditor.all.js"></script>
<script type="text/javascript" src="${path}/js/upload.js"></script>
<script type="text/javascript">
	var doc = $(document);
	$(function() {
		$.form.init(); //初始化表单
		window.addform = {};
		addform.saveData = function() {
			var form = new mini.Form("#umprotectAreaForm");
			form.validate();
			if (form.isValid() == false) {
				return;
			}
			var data = [];
			var obj = null;
			var flags = document.getElementsByName("flag");
			var protectBasicIds = document.getElementsByName("protectBasicId");
			var areas = document.getElementsByName("area");
			var delimitOrgans = document.getElementsByName("delimitOrgan");
			var publishOrgans = document.getElementsByName("publishOrgan");
			var publishDates = document.getElementsByName("publishDate");
			var changeSituations = document
					.getElementsByName("changeSituation");
			for (var i = 0, a = protectBasicIds.length; i < a; i++) {
				obj = {};
				obj.flag = flags[i].value;
				obj.protectBasicId = protectBasicIds[i].value;
				obj.area = areas[i].value;
				obj.delimitOrgan = delimitOrgans[i].value;
				obj.publishOrgan = publishOrgans[i].value;
				obj.publishDate = publishDates[i].value;
				obj.changeSituation = changeSituations[i].value;
				data.push(obj);
			}
			$.form.saveOtherData({
				url : "${path}/mgr/protectArea/addObj",
				showMsg : true,//是否显示提示信息（返回参数必须是msg，json类型数据）
				ortherData : mini.encode(data),
				id : "umprotectAreaForm"
			});
		};
	});

	//页面初始化时，执行该函数资源类型
	$.form.loadFormSuccess = function() {
		if (!mini.get("protectId").value > 0) {
			mini.get("basicId").setValue("${param.basicId}");
			mini.get("basicName").setValue(decodeURI("${name}"));
		}
	};
	//页面初始化时，执行该函数资源类型
	window.onload = function() {
		if (!mini.get("protectId").value > 0) {
			mini.get("basicId").setValue("${param.basicId}");
			mini.get("basicName").setValue(decodeURI("${name}"));
		}
	};
</script>
</html>